const explorationService = require('../services/explorationService')
const explorationController = {
    explorationFind : async(req,res,next)=>{
        if(req.query.userid){
            let data = await explorationService.explorationfind(req.query.userid)
            res.send(data)
        }else{
            let data = await explorationService.explorationfind()
            res.send(data)
        }
    },

    explorationUpdata : async(req,res,next)=>{
        await explorationService.explorationupdata(req.body,req.query)
        console.log(req.body,req.query)
        res.send({ok:1})
    },

    explorationDelete: async (req,res,next)=>{
        await explorationService.explorationdelete(req.query)
        res.send({ok:1})
    },

    explorationAdd: async(req,res,next)=>{
        await explorationService.explorationadd(req.body,req.file)
        res.send({ok:1})
    }
}

module.exports = explorationController